package com.ddzh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ddzh.pojo.CheckItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckItemMapper extends BaseMapper<CheckItem> {
    @Select("select cit.* from check_group_item_t cgit inner  join check_item_t cit on cgit.item_id = cit.id\n" +
            "where cgit.group_id=#{groupId}")
    List<CheckItem> getDetail(@Param("groupId") Long groupId);

    @Select("select * from check_item_t where name=#{name} and is_delete=0")
    CheckItem findByName(@Param("name") String name);


    @Select("select * from check_item_t where code=#{code} and is_delete=0")
    CheckItem findByCode(@Param("code") String code);
}
